<script language="javascript">
	$(document).ready(function(){		
		getDatePicker('birthday');	
	});
	var baseUrl = '<?php echo $this->baseUrl(); ?>';
	// datepicker
	function getDatePicker(_id) {	
	$("#"+_id).datepicker({
		 showOn:'button',
		 dateFormat:"dd-mm-yy",
		 buttonImage:baseUrl+'/public/templates/admin/js/calendar/images/calendar.gif',
		 buttonImageOnly:true,
		 yearRange: '1905:{year}',
		 changeMonth:true,
		 changeYear:true,
		 showMonthAfterYear: true
		 //minDate:0
	   });
	 }
</script>
<?php 
    $product = new AdminDthink_Model_Product(); 
    if($this->data['birthday'] == '0000-00-00')
    {
        $birthday = '';
    }
    else
    {
        $birthday = $product->convertToTime($this->data['birthday']);
    }
?>
<div class="heading">
    <div class="left_heading"></div>
                                
    <div class="content_heading">
        <h3>Thông tin tài khoản</h3>
    </div>
                                
    <div class="right_heading"></div>
</div><!-- End .heading -->

<div class="main_content">
    <form name="form_content" action="" method="post" enctype="multipart/form-data">      
        <table class="table_content">
            <tr>
                <td class="label" style="color: #000000;">Thông tin tài khoản</td>
                <td class="label2">&nbsp;</td>
                <td></td>
            </tr>
            <tr>
            	<td class="label"><?php echo $this->formLabel('email', 'Địa chỉ Email'); ?></td>
            	<td class="label2"><?php echo $this->data['email']; ?></td>
            	<td><span class="msg"><?php echo $this->errorEmail; ?></span></td>
            </tr>
            <tr>
            	<td class="label"><?php echo $this->formLabel('level', 'Quyền hạn'); ?></td>
            	<td class="label2"><?php echo $this->formSelect('level', $this->data['level'], 
                    array('id' => 'level', 'class' => 'input'),
          			array('0' => 'Quản trị', '1' => 'Nhân viên', '2' => 'Doanh nghiệp', '3' => 'Thành viên')); ?></td>
            	<td></td>
            </tr>
            <tr>
            	<td class="label"><?php echo $this->formLabel('status', 'Trạng thái'); ?></td>
            	<td class="label2"><?php echo $this->formSelect('status', $this->data['status'], 
                    array('id' => 'level', 'class' => 'input'),
          			array('1' => 'Hoạt động', '0' => 'Khóa')); ?></td>
            	<td></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td></td>
            </tr>
            <tr>
                <td class="label" style="color: #000000;">Thông tin cá nhân</td>
                <td class="label2">&nbsp;</td>
                <td></td>
            </tr>
            <tr>
                <td class="label"><?php echo $this->formLabel('fullname', 'Tên đầy đủ'); ?><span class="msg"> * </span></td>
                <td class="label2"><?php echo $this->formText('fullname', $this->data['fullname'], array('id' => 'fullname', 'class' => 'input')); ?></td>
                <td><span class="msg"><?php echo $this->errorFullname; ?></span></td>
            </tr>
            <tr>
                <td class="label"><?php echo $this->formLabel('gender', 'Giới tính'); ?></td>
                <td class="label2">
                    <?php echo $this->formSelect('gender', $this->data['gender'], array(
                        'id' => 'gender',
                        'class' => 'input'),
                            array(
                                '1' => 'Nam',
                                '2' => 'Nữ',
                    )); ?>
                </td>
                <td></td>
            </tr>
            <tr>
                <td class="label"><?php echo $this->formLabel('birthday', 'Ngày sinh'); ?></td>
                <td class="label2"><?php echo $this->formText('birthday', $birthday, array('id' => 'birthday', 'class' => 'input')); ?></td>
                <td><span class="msg"><?php echo $this->errorBirthday; ?></span></td>
            </tr>
            <tr>
                <td class="label"><?php echo $this->formLabel('avatar', 'Ảnh đại diện'); ?></td>
				<td class="label2">
                <?php if($this->data['avatar'] != '0') : ?>
				<img src="<?php echo $this->baseUrl('/public/files/user/') . $this->data['avatar']; ?>" width="40px" height="40px" style="float: left;" data-tooltip="sticky<?php echo $this->data['user_id']; ?>">
				<?php else : ?>
				<img src="<?php echo $this->baseUrl('/public/files/user/'); ?>no-avatar.gif" width="40px" height="40px" style="float: left;" data-tooltip="sticky<?php echo $this->data['user_id']; ?>">
				<?php endif; ?>
				<?php echo $this->formSubmit('delImg', 'Hủy ảnh', array('class' => 'button', 'style' => 'margin-left: 10px; margin-top: 0px; float: left; position: relative;', 'onclick' => 'return del_img()')); ?>
                </td>
            </tr>
            <tr>
                <td class="label"><?php echo $this->formLabel('avatar', 'Ảnh mới (nếu có)'); ?></td>
				<td class="label2"><?php echo $this->formFile('avatar', array('id' => 'avatar', 'class' => 'input')); ?></td>
				<td><span class="msg"><?php echo $this->errorAvatar; ?></span></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td colspan="2"><span class="msg"><?php echo $this->error; ?></span></td>
            </tr>
            <tr>
                <td class="label">&nbsp;</td>
                <td>
                    <input class="button" type="submit" name="submit" value="Cập nhật">
					<input class="button" type="reset" name="reset" value="Nhập lại">
                </td>
                <td></td>
            </tr>
        </table>
    </form>
    <div id="mystickytooltip" class="stickytooltip">
	    <div id="sticky<?php echo $this->data['user_id']; ?>" class="atip" style="width:auto; height:auto; text-align:center;">
            <?php if($this->data['avatar'] != '0') : ?>
	    	<img style="width: 250px; height: 250px; text-align:center;" src="<?php echo $this->baseUrl('/public/files/user/') . $this->data['avatar']; ?>">
            <?php else : ?>
            <img style="width: 250px; height: 250px; text-align:center;" src="<?php echo $this->baseUrl('/public/files/user/'); ?>no-avatar.gif">
            <?php endif; ?>
	    </div>
    </div>
</div><!-- End .main_content -->  